﻿using System;
using BusinessObjects;
using System.Collections.ObjectModel;
using System.Windows.Threading;
using System.Collections.Generic;
namespace MainGameModule.Models
{
    public interface IGameModel
    {
        void InitializeCommunicator();

        void PublishMovePlayerMessage( MoveMessage message );

        void Subscribe( Player player );
        event Action<Player> SubscribeSucceeded;
        event Action<Exception> SubscribeFailed;

        event Action<int> PlayerUnsubscribed;

        void Initialize( Game game );
        event Action InitializeSucceeded;

        event Action<Game> GameInitialized;

        void UnSubscribe( Player player );
        event Action UnSubscribeSucceeded;
        event Action<Exception> UnSubscribeFailed;

        event Action<string> NotificationReceived;
        event Action<MoveMessage> PlayerActionReceived;

        event Action HitRubbishReceived;
        event Action HitHerbReceived;
        event Action ShowQuestionReceived;

        event Action<Exception> ServerFailed;

        void UpdateSeverBinsStatus( Player player, Rubbish rubbish );
        void UpdateSeverBinsStatus( Player player, Rubbish rubbish, RubbishRemovalStatus status );

        event Action<BinsUpdateMessage> BinsUpdateMessageReceived;

        void DisconnectMainPlayer();

        void StartEvent( Event playerEvent );
        void JoinEvent( EventFeedback ef );
        void SupportEvent( EventFeedback ef );

        void HelWithQuestion(); // and send the answer
        void SendThankYouNote();

        event Action<ChatMessage> ChatMessageReceived;
        void SendChatMessage( ChatMessage message );

        void LoadRegionObjectsFromGrid( Game game );
        event Action<List<RegionObjectHolder>> RubbishUpdateReceived;

        void SendPlayerConnectionRequest( PlayerConnectionMessage payload );
        void SendPlayerConnectionResponse( PlayerConnectionMessage payload );

        event Action<PlayerConnectionMessage> PlayerConnectionRequestReceived;
        event Action<PlayerConnectionMessage> PlayerConnectionResponseReceived;

        event Action<Event> SupportQuestReceived;
        event Action<Event> JoinQuestReceived;
        event Action<EventFeedback, bool> QuestResponseReceived;
        event Action<TeamEvent> QuestCompleted;

        void PublishBuildQuest( BuildQuestUpdateHolder update );
        event Action<int, int, RegionObjectHolder> PublishBuildQuestReceived;
        
        event Action<Event> BuildQuestRequestReceived;
        event Action<TeamEvent> BuildTeamQuestRequestReceived;

        void PublishPlayerBadgeWon( BadgeUpdateHolder buh );
        event Action<BadgeUpdateHolder> PublishBadgeWon;
    }
}
